<?php
namespace app\admin\controller;
class Word extends Base
{
    public function edit()
    {
        if(is_post()){
            $d = $this->post;
            $rule = [
                'id'=>'require',
            ];
            $msg = [];
            check($rule,$msg,$d);
            $d['update_time'] = time();
            unset($d['file']);
            $this->db->update('word',$d);
            m('Attachment','xcom')->imgSure('word',$d['id'],$d);
            cookie('js_msg','修改成功');
            cookie('js_function','f5');
            return suc();
        }
        $info = $this->db->query("select * from word where website_id=?",[$this->web_site_id],1);
        return $this->fetch(['info'=>$info]);
    }
}
